using System;
using UnityEditor;
using UnityEngine;

namespace ParticleExporter
{
    [CustomEditor(typeof(ParticleExporterCamera))]
    public class ParticleExporterEditor : Editor
    {
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();
            foreach (var method in target.GetType().GetMethods())
            {
                var at = method.GetCustomAttributes(typeof(MethodButtonAttribute), false);
                if (at.Length == 0) continue;
                if (!GUILayout.Button(method.Name)) continue;
                method.Invoke(target, Array.Empty<object>());
            }
        }
    }
}